package ch.bfh.swos.learnaid.repository;

import javax.inject.Inject;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import ch.bfh.swos.learnaid.model.Author;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("/persistenceContext.xml")
public class AuthorRepositoryIT {

    @Inject
    private AuthorRepository authorRepository;

    @Test
    public void test() {
        // CREATE
        Author author = new Author();
        author.setFirstname("Vorname");
        author.setLastname("Nachname");
        author.setLogin("benutzername");
        author.setPassword("secret");;
        authorRepository.save(author);
    }
}
